furny.ga
Class FurnEntry

java.lang.Object
  extended by furny.ga.FurnEntry
All Implemented Interfaces:
java.lang.Comparable<FurnEntry>

public class FurnEntry
extends java.lang.Object
implements java.lang.Comparable<FurnEntry>

This is one gene segment for a furniture with a position and rotation in the room.

Since:
11.08.2012
Author:
Stephan Dreyer

Field Summary
private  math.geom2d.polygon.Polygon2D bounds
           
private  Furniture furniture
           
private static java.util.logging.Logger LOGGER
           
private  RoomVector vector
           
 
Constructor Summary
FurnEntry(RoomVector vector, Furniture furniture)
          Create a new furniture entry.
 
Method Summary
protected  FurnEntry clone()
           
 int compareTo(FurnEntry o)
           
 com.jme3.scene.Node createTranslatedModel()
          Creates a copy of the furnitures model and translates/rotates it.
 boolean equals(java.lang.Object obj)
           
 math.geom2d.polygon.Polygon2D getBounds()
          Getter for the outter bounds of the furniture.
 Furniture getFurniture()
          Getter for the furniture.
 RoomVector getVector()
          Getter for the room vector.
 int hashCode()
           
static void main(java.lang.String[] args)
          Main method for testing.
 void setFurniture(Furniture furniture)
          Setter for the furniture.
 void setVector(RoomVector vector)
          Setter for the room vector.
 java.lang.String toString()
           
private  void updateShape()
          Updates the bounds shape.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

LOGGER

private static final java.util.logging.Logger LOGGER

vector

private RoomVector vector

furniture

private Furniture furniture

bounds

private math.geom2d.polygon.Polygon2D bounds
Constructor Detail

FurnEntry

public FurnEntry(RoomVector vector,
                 Furniture furniture)
Create a new furniture entry.

Parameters:
vector - The room vector that represents location and rotation.
furniture - The furniture.
Since:
11.08.2012
Method Detail

createTranslatedModel

public com.jme3.scene.Node createTranslatedModel()
Creates a copy of the furnitures model and translates/rotates it.

Returns:
The translated and rotated model.
Since:
11.08.2012

getBounds

public math.geom2d.polygon.Polygon2D getBounds()
Getter for the outter bounds of the furniture.

Returns:
The bounds.
Since:
11.08.2012

updateShape

private void updateShape()
Updates the bounds shape. Must be called when the room vector or furniture have been exchanged.

Since:
11.08.2012

getVector

public RoomVector getVector()
Getter for the room vector.

Returns:
The room vector.
Since:
11.08.2012

setVector

public void setVector(RoomVector vector)
Setter for the room vector.

Parameters:
vector - The room vector.
Since:
11.08.2012

getFurniture

public Furniture getFurniture()
Getter for the furniture.

Returns:
The furniture.
Since:
11.08.2012

setFurniture

public void setFurniture(Furniture furniture)
Setter for the furniture.

Parameters:
furniture - The furniture.
Since:
11.08.2012

clone

protected FurnEntry clone()
Overrides:
clone in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

compareTo

public int compareTo(FurnEntry o)
Specified by:
compareTo in interface java.lang.Comparable<FurnEntry>

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

main

public static void main(java.lang.String[] args)
Main method for testing.

Parameters:
args - arguments
Since:
11.08.2012